Date.prototype.format = function (fmt) { //
    var o = {
        "M+": this.getMonth() + 1, //Month
        "d+": this.getDate(), //Day
        "h+": this.getHours(), //Hour
        "m+": this.getMinutes(), //Minute
        "s+": this.getSeconds(), //Second
        "q+": Math.floor((this.getMonth() + 3) / 3), //Season
        "S": this.getMilliseconds() //millesecond
    };
    if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() +

        "").substr(4 - RegExp.$1.length));
    for (var k in o)
        if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1,

            (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
    return fmt;
};
Date.prototype.format = function (fmt) { //
    var o = {
        "M+": this.getMonth() + 1, //Month
        "d+": this.getDate(), //Day
        "h+": this.getHours(), //Hour
        "m+": this.getMinutes(), //Minute
        "s+": this.getSeconds(), //Second
        "q+": Math.floor((this.getMonth() + 3) / 3), //Season
        "S": this.getMilliseconds() //millesecond
    };
    if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() +

        "").substr(4 - RegExp.$1.length));
    for (var k in o)
        if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1,

            (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
    return fmt;
};
function closeDialog(){
    art.dialog.close();
}
//需要父级页面定义dataReload
function parentDataReload(){
    art.dialog.opener.dataReload();
}
//需要父级页面定义getSelections
function parentGetSelections(){
    return art.dialog.opener.getSelections();
}
function msg(content, lock) {
    top.art.dialog({
        title: '提示',
        content: content,
        lock: lock,
        opacity: 0.6,
        time: 1.5
    });
}
// function alert(content){
//     art.dialog.alert(content);
// }
var TOP_LOADING;
function loading(){
    return TOP_LOADING = top.art.dialog({
        title: '提示',
        content: '正在进行中.请稍等...',
        lock: true,
        esc: false,
        opacity: 0.6,
        cancel:false
    });
}
function closeTopLoading(){
    TOP_LOADING.close();
}

function openWindow(title, url, option){
    var options = {
        title: title,
        width: 630,
        height: 520,
        lock: true,
        opacity: 0.4,
        resize: true
    };
    $.extend(options, option);
    art.dialog.open(url, options);
}
//关闭当前页面，并刷新父页面
function closeReload(){
    setTimeout(function () {
        closeDialog();  //关闭当前dialog
        parentDataReload();//刷新父级页面数据
    },1000)
}